//
//  DataBaseHandle.h
//  UI_20_数据库
//
//  Created by dllo on 16/4/28.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <sqlite3.h>
#import "MineRegidterModel.h"
#import "DiscountModel.h"
#import "DiscountMoreHot_areaListModel.h"
#import "DiscountMoreDidcount_topicListModel.h"
#import "DiscountMoreHot_goodsModel.h"

#import "DiscountListModel.h"
//#import "ActivityModel.h"
//#import "MovieDataVCModel.h"
//#import "RegisterModel.h"

@interface DataBaseHandle : NSObject

//声明
+(DataBaseHandle *)shareDataBaseHandle;
-(void)openDB;
-(void)openDBWithName:(NSString *)userName;
- (void)close;
-(void)creatTableWithSQname:(NSString *)sqName;
-(void)creatDicountTableWithSQname:(NSString *)sqName;

-(void)insertDiscount:(DiscountModel *)discountModel withUserName:(NSString *)userName withSQname:(NSString *)sqName;
-(void)insertDiscountMore:(DiscountMoreHot_areaListModel *)discountModel withUserName:(NSString *)userName withSQname:(NSString *)sqName;
-(void)insertDiscountMore2:(DiscountMoreDidcount_topicListModel *)discountModel withUserName:(NSString *)userName withSQname:(NSString *)sqName;
-(void)insertDiscountMore3:(DiscountMoreHot_goodsModel *)discountModel withUserName:(NSString *)userName withSQname:(NSString *)sqName;

//-(void)deleteTable:(NSString *)title withSQname:(NSString *)sqName;
-(void)dropTabelWithSQname:(NSString *)sqName;

//-(void)insertMovie:(MovieDataVCModel *)movieModel withUserName:(NSString *)userName withSQname:(NSString *)sqName;
-(void)insertMovie:(MineRegidterModel *)registerModel withSQname:(NSString *)sqName;


-(void)insert:(id)model withUserName:(NSString *)userName withSQname:(NSString *)sqName;
-(NSMutableArray *)selectDiscount:(NSString *)userName withSQname:(NSString *)sqName;
-(NSMutableArray *)selectAllWithSQname:(NSString *)sqName withCompare:(BOOL)compare;

- (BOOL)isSavedDiscount:(NSString *)discountID;

//-(BOOL)deleteDiscountWithID:(NSString *)discountID;
-(BOOL)deleteDiscountWithID:(NSString *)discountID userName:(NSString *)userName;


@end
